package com.gxa.index.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxa.index.entity.Business;
import com.gxa.index.mapper.BussinessMapper;
import com.gxa.index.service.BussinessService;
import com.gxa.index.vo.HeadlinesVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BussinessServiceImpl extends ServiceImpl<BussinessMapper, Business> implements BussinessService {
    @Autowired
    private BussinessMapper bussinessMapper;

    /**
     *
     * @param headlinesVo
     * @return
     * 筛选条件
     * 1.额度区间
     * 2.行业和领域
     * 3.浏览量排序
     * 4分页
     */
    @Override
    public List<Business> showAllheadlines(HeadlinesVo headlinesVo) {
        Integer current=(headlinesVo.getCurrentPage()-1)*headlinesVo.getPageSize();
        headlinesVo.setCurrentPage(current);
        return bussinessMapper.showAllheadlines(headlinesVo);
    }
}
